package com.gin.no_gay_alliance.viewmodel.emote;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 表情分类
 *
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/8/30 14:06
 **/
public class EmoteCategory {
    /**
     * 分类名
     */
    public String name;
    /**
     * 版本号(如果本分类来自同一个来源)
     */
    public String version;
    /**
     * 来源地址(如果本分类来自同一个来源)
     */
    public String source;
    /**
     * 表情包分组
     */
    public List<EmoteGroupModel> groups;

    public EmoteCategory(ThirdPartyEmoteCategory category) {
        this.name = category.name;
        this.version = category.version;
        this.source = category.source;
        this.groups = category.groups.stream().map(EmoteGroupModel::new).collect(Collectors.toCollection(ArrayList::new));
    }

    public EmoteCategory(String name, List<EmoteGroupModel> groups) {
        this.name = name;
        this.groups = groups;
    }
}
